package com.mojo.elastic.pojo;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.StringJoiner;

/**
 * @author <a href="mailto:mojo_jj@163.com">Mojo</a>
 */
@Document(indexName = "bank")
public class Bank {
    @Id
    private Integer id;
    @Field(name = "account_number")
    private Integer accountNumber;
    @Field(type = FieldType.Integer)
    private Integer balance;
    private String firstname;
    private String lastname;
    private Integer age;
    private String gender;
    private String address;
    private String email;
    private String city;
    private String state;

    public Integer getId() {
        return id;
    }

    public Bank setId(Integer id) {
        this.id = id;
        return this;
    }

    public Integer getAccountNumber() {
        return accountNumber;
    }

    public Bank setAccountNumber(Integer accountNumber) {
        this.accountNumber = accountNumber;
        return this;
    }

    public Integer getBalance() {
        return balance;
    }

    public Bank setBalance(Integer balance) {
        this.balance = balance;
        return this;
    }

    public String getFirstname() {
        return firstname;
    }

    public Bank setFirstname(String firstname) {
        this.firstname = firstname;
        return this;
    }

    public String getLastname() {
        return lastname;
    }

    public Bank setLastname(String lastname) {
        this.lastname = lastname;
        return this;
    }

    public Integer getAge() {
        return age;
    }

    public Bank setAge(Integer age) {
        this.age = age;
        return this;
    }

    public String getGender() {
        return gender;
    }

    public Bank setGender(String gender) {
        this.gender = gender;
        return this;
    }

    public String getAddress() {
        return address;
    }

    public Bank setAddress(String address) {
        this.address = address;
        return this;
    }

    public String getEmail() {
        return email;
    }

    public Bank setEmail(String email) {
        this.email = email;
        return this;
    }

    public String getCity() {
        return city;
    }

    public Bank setCity(String city) {
        this.city = city;
        return this;
    }

    public String getState() {
        return state;
    }

    public Bank setState(String state) {
        this.state = state;
        return this;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", Bank.class.getSimpleName() + "[", "]")
                .add("accountNumber=" + accountNumber)
                .add("balance=" + balance)
                .add("lastname='" + lastname + "'")
                .add("age=" + age)
                .add("gender='" + gender + "'")
                .add("address='" + address + "'")
                .add("email='" + email + "'")
                .add("city='" + city + "'")
                .add("state='" + state + "'")
                .toString();
    }
}
